package com.geekaca.d4.regx;

public class Test4 {
    public static void main(String[] args) {

        // 分割
        String names = "小路dsfsf容儿dsfsdf老王dsdfsdf小何sdfsdf宝强sdfsdf强文sdf";
        String[] split = names.split("\\w+");
        for (int i = 0; i < split.length; i++) {
            System.out.println(split[i]);
        }

        // 替换
        String s = names.replaceAll("\\w+", " ");
        System.out.println(s);
    }
}
